package org.example;

public class homework2 {
    public static void main(String[] args) {
        MyThread t1=new MyThread();
        t1.start();
        Thread t2=new Thread(new MyRunnable());
        t2.start();
        Thread t3=new Thread(){
            @Override
            public void run() {
                System.out.println("创建线程方法3...");
            }
        };
        t3.start();
        Thread t4=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("创建线程方法4...");
            }
        });
        t4.start();
        Thread t5 = new Thread(()->{
            System.out.println("创建线程方法5...");
        });
        t5.start();
    }
}
class MyThread extends Thread{
    @Override
    public void run() {
        System.out.println("创建线程方法1...");
    }
}
class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("创建线程方法2...");
    }
}
